void main() {
  var p = Parrot();
  p.walk();
  p.fly();

  var d = Duck();
  d.swim();
}

abstract class Animal {}

abstract class Bird extends Animal {}

// 通过mixin来定义每种不同Animal的行为属性功能， 如： 走 飞 ...
mixin Walker {
  void walk() => print('I am walking');
}

mixin Fly {
  void fly() => print('I am flying');
}

mixin Swim {
  void swim() => print('I am swimming');
}

class Parrot extends Bird with Walker, Fly {}

class Duck extends Bird with Swim {}
